package com.greatpengcode.service.impl;

import com.greatpengcode.dao.DepartmentDao;
import com.greatpengcode.pojo.Department;
import com.greatpengcode.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DepartmentServiceImpl implements DepartmentService {
    @Autowired
    private DepartmentDao departmentDao;
    @Override
    public List<Department> getDepartments() {
        List<Department> departments = departmentDao.getDepartments();
        return departments;
    }

    @Override
    public Department getDepartmentById(Integer id) {
        Department department = departmentDao.getDepartmentById(id);
        return department;
    }
}
